from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

class TestRubin():
    def setup(self):
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()


    #访问地址输入用户名密码然后点击登陆
    def testrrubin(self):
        self.driver.get('https://pan.rubinchu.com/')
        action = ActionChains(self.driver)
        element1 = self.driver.find_element(By.XPATH,'//*[@id="app"]/div/div/div[1]/label[1]/input')
        element2 = self.driver.find_element(By.XPATH,'//*[@id="app"]/div/div/div[1]/label[2]/input')
        action.click(element1)
        action.send_keys_to_element(element1,'alitest')
        action.click(element2)
        action.send_keys_to_element(element2,'12345678')
        action.click(self.driver.find_element(By.XPATH,'//*[@id="app"]/div/div/div[1]/button'))
        action.perform()   #决定了执行方法



    